package com.teradyne.phoenix.client.views;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;

public class AppMenuViewImpl extends Composite implements AppMenuView {
	
	
	private Presenter presenter;
	
	private static AppMenusUiBinder uiBinder = GWT
			.create(AppMenusUiBinder.class);
	
	interface AppMenusUiBinder extends UiBinder<Widget, AppMenuViewImpl> {
	}
	
	@UiField Anchor user;
	
	@UiField Anchor roles;
	
	public AppMenuViewImpl() {
		initWidget(uiBinder.createAndBindUi(this));
	}
	
	@UiHandler("roles")
	void rolesButtonClicked(ClickEvent e) {
		presenter.gotoRolesPlace();
	}
	
	@UiHandler("user")
	void userButtonClicked(ClickEvent e) {
		presenter.gotoUserPlace();
	}

	@Override
	public void setPresenter(Presenter presenter) {
		this.presenter = presenter;
	}

}
